package com.laicunba.ext.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.laicunba.ext.service.SlaveUserService;
import com.laicunba.pojo.UserDO;

@Service
public class SlaveUserServiceImpl extends BaseService implements SlaveUserService {

	@Override
	public UserDO findByInviteCode(String inviteCode) {
		return slaveGenericQueryDao.selectOne("SLAVE_USER.findByInviteCode", inviteCode);
	}
	
	@Override
	public List<Map<String, Object>> findInviteRankList(String beginDate, String endDate, int limit) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("beginDate", beginDate);
		map.put("endDate", endDate);
		map.put("limit", limit);
		return slaveGenericQueryDao.selectList("SLAVE_USER.findInviteRankList", map);
	}
	
	@Override
	public int findInviteRegistCount(String userId, String beginDate, String endDate) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("userId", userId);
		map.put("beginDate", beginDate);
		map.put("endDate", endDate);
		return slaveGenericQueryDao.selectOne("SLAVE_USER.findInviteRegistCount", map);
	}

}
